<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
    var jsondata = [{"男": 4, "女": 3, "不详": 0}, {"男one": 23, "女two": 12, "不详two": 10}];

    //根据键名获取键值
    var man=jsondata[0].男;
    console.log(man); //result:4

    //循环得到json的键和值
    for (var item in jsondata[0]) {
        console.log(item);//得到键
        console.log(jsondata[0][item]);//得到键对应的值
    }



</script>
</body>
</html>